package com.studio5704website.application;

import com.studio5704website.application.data.UserData;
import com.studio5704website.infrastructure.mapper.UserQueryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

/**
 * @author 高威
 * 从数据库查找返回UserData的服务
 */
@Repository
public class UserQueryService {
    private UserQueryMapper userQueryMapper;

    @Autowired
    public UserQueryService(UserQueryMapper userQueryMapper) {
        this.userQueryMapper = userQueryMapper;
    }
    public UserData findByUsername(String username) {
        return userQueryMapper.findByUsername(username);
    }

    public UserData findById(String id) {
        return userQueryMapper.findById(id);
    }
}
